home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / PInterfaces / PictUtil.p < prev    next >
Encoding:
Text File  |  1992-01-29  |  5.0 KB  |  146 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Monday, September 16, 1991 at 12:03 AM
  4.  PictUtil.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1990-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT PictUtil;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingPictUtil}
  22. {$SETC UsingPictUtil := 1}
  23.  
  24. {$I+}
  25. {$SETC PictUtilIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingPalettes}
  31. {$I $$Shell(PInterfaces)Palettes.p}
  32. {$ENDC}
  33. {$SETC UsingIncludes := PictUtilIncludes}
  34.  
  35. CONST
  36.  
  37. { verbs for the GetPictInfo, GetPixMapInfo, and NewPictInfo calls }
  38. returnColorTable = 1;
  39. returnPalette = 2;
  40. recordComments = 4;
  41. recordFontInfo = 8;
  42. suppressBlackAndWhite = 16;
  43.  
  44. { color pick methods }
  45. systemMethod = 0;                    {system color pick method}
  46. popularMethod = 1;                    {method that chooses the most popular set of colors}
  47. medianMethod = 2;                    {method that chooses a good average mix of colors}
  48.  
  49. { color bank types }
  50. ColorBankIsCustom = -1;
  51. ColorBankIsExactAnd555 = 0;
  52. ColorBankIs555 = 1;
  53.  
  54. TYPE
  55. PictInfoID = LONGINT;
  56.  
  57. CommentSpecPtr = ^CommentSpec;
  58. CommentSpecHandle = ^CommentSpecPtr;
  59. CommentSpec = RECORD
  60.  count: INTEGER;                    { number of occurrances of this comment ID }
  61.  ID: INTEGER;                        { ID for the comment in the picture }
  62.  END;
  63.  
  64. FontSpecPtr = ^FontSpec;
  65. FontSpecHandle = ^FontSpecPtr;
  66. FontSpec = RECORD
  67.  pictFontID: INTEGER;                { ID of the font in the picture }
  68.  sysFontID: INTEGER;                { ID of the same font in the current system file }
  69.  size: ARRAY [0..3] OF LONGINT;        { bit array of all the sizes found (1..127) (bit 0 means > 127) }
  70.  style: INTEGER;                    { combined style of all occurrances of the font }
  71.  nameOffset: LONGINT;                { offset into the fontNamesHdl handle for the font’s name }
  72.  END;
  73.  
  74. PictInfoPtr = ^PictInfo;
  75. PictInfoHandle = ^PictInfoPtr;
  76. PictInfo = RECORD
  77.  version: INTEGER;                    { this is always zero, for now }
  78.  uniqueColors: LONGINT;                { the number of actual colors in the picture(s)/pixmap(s) }
  79.  thePalette: PaletteHandle;            { handle to the palette information }
  80.  theColorTable: CTabHandle;            { handle to the color table }
  81.  hRes: Fixed;                        { maximum horizontal resolution for all the pixmaps }
  82.  vRes: Fixed;                        { maximum vertical resolution for all the pixmaps }
  83.  depth: INTEGER;                    { maximum depth for all the pixmaps (in the picture) }
  84.  sourceRect: Rect;                    { the picture frame rectangle (this contains the entire picture) }
  85.  textCount: LONGINT;                { total number of text strings in the picture }
  86.  lineCount: LONGINT;                { total number of lines in the picture }
  87.  rectCount: LONGINT;                { total number of rectangles in the picture }
  88.  rRectCount: LONGINT;                { total number of round rectangles in the picture }
  89.  ovalCount: LONGINT;                { total number of ovals in the picture }
  90.  arcCount: LONGINT;                    { total number of arcs in the picture }
  91.  polyCount: LONGINT;                { total number of polygons in the picture }
  92.  regionCount: LONGINT;                { total number of regions in the picture }
  93.  bitMapCount: LONGINT;                { total number of bitmaps in the picture }
  94.  pixMapCount: LONGINT;                { total number of pixmaps in the picture }
  95.  commentCount: LONGINT;                { total number of comments in the picture }
  96.  uniqueComments: LONGINT;            { the number of unique comments in the picture }
  97.  commentHandle: CommentSpecHandle;    { handle to all the comment information }
  98.  uniqueFonts: LONGINT;                { the number of unique fonts in the picture }
  99.  fontHandle: FontSpecHandle;        { handle to the FontSpec information }
  100.  fontNamesHandle: Handle;            { handle to the font names }
  101.  reserved1: LONGINT;
  102.  reserved2: LONGINT;
  103.  END;
  104.  
  105.  
  106. FUNCTION GetPictInfo(thePictHandle: PicHandle;
  107.                      VAR thePictInfo: PictInfo;
  108.                      verb: INTEGER;
  109.                      colorsRequested: INTEGER;
  110.                      colorPickMethod: INTEGER;
  111.                      version: INTEGER): OSErr;
  112.  INLINE $303C,$0800,$A831;
  113. FUNCTION GetPixMapInfo(thePixMapHandle: PixMapHandle;
  114.                        VAR thePictInfo: PictInfo;
  115.                        verb: INTEGER;
  116.                        colorsRequested: INTEGER;
  117.                        colorPickMethod: INTEGER;
  118.                        version: INTEGER): OSErr;
  119.  INLINE $303C,$0801,$A831;
  120. FUNCTION NewPictInfo(VAR thePictInfoID: PictInfoID;
  121.                      verb: INTEGER;
  122.                      colorsRequested: INTEGER;
  123.                      colorPickMethod: INTEGER;
  124.                      version: INTEGER): OSErr;
  125.  INLINE $303C,$0602,$A831;
  126. FUNCTION RecordPictInfo(thePictInfoID: PictInfoID;
  127.                         thePictHandle: PicHandle): OSErr;
  128.  INLINE $303C,$0403,$A831;
  129. FUNCTION RecordPixMapInfo(thePictInfoID: PictInfoID;
  130.                           thePixMapHandle: PixMapHandle): OSErr;
  131.  INLINE $303C,$0404,$A831;
  132. FUNCTION RetrievePictInfo(thePictInfoID: PictInfoID;
  133.                           VAR thePictInfo: PictInfo;
  134.                           colorsRequested: INTEGER): OSErr;
  135.  INLINE $303C,$0505,$A831;
  136. FUNCTION DisposPictInfo(thePictInfoID: PictInfoID): OSErr;
  137.  INLINE $303C,$0206,$A831;
  138.  
  139.  
  140. {$ENDC} { UsingPictUtil }
  141.  
  142. {$IFC NOT UsingIncludes}
  143.  END.
  144. {$ENDC}
  145.  
  146.